package cn.edu.sdjzu.xg.kcsj.security;

import cn.edu.sdjzu.xg.kcsj.domain.Faculty;

import java.io.Serializable;
import java.util.Collection;

public class User implements Comparable<User>, Serializable {
    private int id;
    private String username;
    private String password;
    private String name;
    private String sex;
    private String politicsStatus;
    private String telephone;
    private Faculty faculty;
    private Boolean available;
    private String introduction;
    private Collection<Role> roles;

    public User(int id, String username, String password, String name,
                String sex, String politicsStatus, String telephone,
                Faculty faculty, Boolean available, String introduction, Collection<Role> roles) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.name = name;
        this.sex = sex;
        this.politicsStatus = politicsStatus;
        this.telephone = telephone;
        this.faculty = faculty;
        this.available = available;
        this.introduction = introduction;
        this.roles = roles;
    }

    public User(int id, String name) {
        this.name = name;
        this.id = id;
    }

    @Override
    public int compareTo(User o) {
        return this.id - o.id;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getPoliticsStatus() {
        return politicsStatus;
    }

    public void setPoliticsStatus(String politicsStatus) {
        this.politicsStatus = politicsStatus;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public Faculty getFaculty() {
        return faculty;
    }

    public void setFaculty(Faculty faculty) {
        this.faculty = faculty;
    }

    public Boolean getAvailable() {
        return available;
    }

    public void setAvailable(Boolean available) {
        this.available = available;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public Collection<Role> getRoles() {
        return roles;
    }

    public void setRoles(Collection<Role> roles) {
        this.roles = roles;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", politicsStatus='" + politicsStatus + '\'' +
                ", telephone='" + telephone + '\'' +
                ", faculty=" + faculty +
                ", available=" + available +
                ", introduction='" + introduction + '\'' +
                ", roles=" + roles +
                '}';
    }
}
